package com.dynamixsoftware.printershare;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.dynamixsoftware.printershare.ActivityRoot;

public class ActivityHelp extends ActivityRoot {

	private boolean fl = false;

	public void onCreate(Bundle var1) {
		super.onCreate(var1);
		this.setContentView(2130903057);
		this.setTitle(2131099671);
		final WebView var2 = (WebView) this.findViewById(2131230777);
		var2.getSettings().setJavaScriptEnabled(true);
		var2.getSettings().setBlockNetworkImage(false);
		var2.getSettings().setLoadsImagesAutomatically(true);
		var2.getSettings().setSupportMultipleWindows(false);
		var2.getSettings().setBuiltInZoomControls(true);
		var2.getSettings().setSupportZoom(true);
		var2.setWebViewClient(new WebViewClient() {
			public void onPageFinished(WebView var1, String var2x) {
				if (!ActivityHelp.this.fl) {
					var2.loadUrl("http://www.printershare.com/help?topic=android-index");
					ActivityHelp.this.fl = true;
				}

			}

			public void onReceivedError(WebView var1, int var2x, String var3, String var4) {
				var2.loadDataWithBaseURL((String) null, "<html><body><b>Error:</b> " + var3 + "</body></html>",
						"text/html", "UTF-8", (String) null);
			}

			public boolean shouldOverrideUrlLoading(WebView var1, String var2x) {
				if (var2x != null && var2x.startsWith("mailto:")) {
					Intent var3 = new Intent("android.intent.action.SEND");
					var3.setType("plain/text");
					int var5 = var2x.indexOf("?");
					String[] var6 = new String[1];
					if (var5 <= 0) {
						var5 = var2x.length();
					}

					var6[0] = var2x.substring(7, var5);
					var3.putExtra("android.intent.extra.EMAIL", var6);
					int var8 = var2x.indexOf("subject=");
					if (var8 > 0) {
						var3.putExtra("android.intent.extra.SUBJECT", var2x.substring(var8 + 8));
					}

					ActivityHelp.this.startActivity(Intent.createChooser(var3, ActivityHelp.this.getResources()
							.getString(2131099719)));
					return true;
				} else {
					return false;
				}
			}
		});
		var2.loadDataWithBaseURL((String) null, "<html><body><b>" + this.getResources().getString(2131099757)
				+ "</b></body></html>", "text/html", "UTF-8", (String) null);
	}
}
